package org.osgi.agents.eqcommands.cm;

import org.eclipse.osgi.framework.console.CommandProvider;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.service.cm.ConfigurationAdmin;
import org.osgi.util.tracker.ServiceTracker;

public class Activator implements BundleActivator {

	private ServiceTracker cmtracker;

	public void start(BundleContext context) throws Exception {
		cmtracker = new ServiceTracker(context, ConfigurationAdmin.class.getName(), null);
		cmtracker.open();
		
		ConfigAdminCommandProvider commands = new ConfigAdminCommandProvider(cmtracker);
		context.registerService(CommandProvider.class.getName(), commands, null);
	}

	public void stop(BundleContext context) throws Exception {
		cmtracker.close();
	}

}
